<script setup>
import {useRouter} from "vue-router";

const userRouter = useRouter();

function goSearch(to) {
    userRouter.push({
            // 隐式传参 url中不显示参数
            // name: 'DetailList',
            // params: {
            //     id: to,
            // }
            // 显示传参 url中显示参数
            path: '/search',
            // query: {
            //     id: to,
        }
    )
}

const goUserInfo = function () {
    userRouter.push({
        path: '/userInfo'
    })
}
</script>
<template>
    <div class="navBar">
        <div class="navLeft">
            <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-31liebiao"></use>
            </svg>
        </div>

        <div class="navContent">
            <span class="item" @click="goUserInfo">我的</span>
            <span class="item1" @click="changeColor">云村</span>
            <span class="item" @click="changeColor">发现</span>
            <span class="item" @click="changeColor">视频</span>
        </div>
        <div class="navRight">
            <svg aria-hidden="true" class="icon" @click="goSearch">
                <use xlink:href="#icon-sousuo"></use>
            </svg>
        </div>

    </div>
</template>
<script>
document.getElementById("item1")
</script>

<style scoped lang="less">
.navBar {
    width: 100%;
    height: 1rem;
    padding: 0.2rem;
    display: flex;
    justify-content: space-between;
    align-content: center;

    .navContent {
        width: 60%;
        height: 100%;
        display: flex;
        justify-content: space-around;
        align-content: center;
        font-size: 0.36rem;

        .item1 {
            color: #E20000;
            font-weight: 900;
        }
    }

    .navLeft {
    }


    .navRight {

    }
}


</style>